package net.xiangcaowuyu.mybatisplussample.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import net.xiangcaowuyu.mybatisplussample.mapper.UserMapper;
import net.xiangcaowuyu.mybatisplussample.domain.User;
import net.xiangcaowuyu.mybatisplussample.service.IUserService;

import javax.annotation.Resource;
import java.util.List;

/**
 * Description:
 *
 * @author : laughing
 * DateTime: 2021-04-22 9:21
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IUserService {

    @Resource
    UserMapper userMapper;

    /**
     * 分页查询
     *
     * @param page 分页对象,xml中可以从里面进行取值,传递参数 Page 即自动分页,必须放在第一位(你可以继承Page实现自己的分页对象)
     * @return
     */
    @Override
    public Page<User> selectUserList(IPage<User> page) {
        return userMapper.selectUserList(page);
    }

    /**
     * 租户的查询
     *
     * @return
     */
    @Override
    public List<User> selectUserTenant() {
        return userMapper.selectUserTenant();
    }
}
